home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tcl8.0 / tests / unixNotfy.test < prev    next >
Encoding:
Text File  |  1997-08-15  |  1.2 KB  |  41 lines  |  [TEXT/ALFA]

  1. # This file contains tests for tclUnixNotfy.c.
  2. #
  3. # This file contains a collection of tests for one or more of the Tcl
  4. # built-in commands.  Sourcing this file into Tcl runs the tests and
  5. # generates output for errors.  No output means no errors were found.
  6. #
  7. # Copyright (c) 1997 by Sun Microsystems, Inc.
  8. #
  9. # See the file "license.terms" for information on usage and redistribution
  10. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11. #
  12. # SCCS: @(#) unixNotfy.test 1.2 97/06/16 17:26:28
  13.  
  14. if {[string compare test [info procs test]] == 1} then {source defs}
  15.  
  16. if {$tcl_platform(platform) != "unix"} {
  17.     return
  18. }
  19. test unixNotfy-1.1 {Tcl_DeleteFileHandler} {
  20.     catch {vwait x}
  21.     set f [open foo w]
  22.     fileevent $f writable {set x 1}
  23.     vwait x
  24.     close $f
  25.     list [catch {vwait x} msg] $msg
  26. } {1 {can't wait for variable "x":  would wait forever}}
  27. test unixNotfy-1.2 {Tcl_DeleteFileHandler} {
  28.     catch {vwait x}
  29.     set f1 [open foo w]
  30.     set f2 [open foo2 w]
  31.     fileevent $f1 writable {set x 1}
  32.     fileevent $f2 writable {set y 1}
  33.     vwait x
  34.     close $f1
  35.     vwait y
  36.     close $f2
  37.     list [catch {vwait x} msg] $msg
  38. } {1 {can't wait for variable "x":  would wait forever}}
  39.  
  40. file delete foo
  41.